﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace VisualWix
{
    /// <summary>
    /// Interaction logic for TargetFileWindow.xaml
    /// </summary>
    public partial class TargetFileWindow : Window
    {
        DirectoryItem targetDirectoryInfo = null;

        public DirectoryItem TargetDirectoryInfo
        {
            get { return targetDirectoryInfo; }
            set { targetDirectoryInfo = value; }
        }

        public FileItem SelectedFile { get; set; }

        public TargetFileWindow()
        {
            InitializeComponent();

            this.Loaded += TargetFileWindow_Loaded;
        }

        void TargetFileWindow_Loaded(object sender, RoutedEventArgs e)
        {
            TreeViewFileInformation.ItemsSource = targetDirectoryInfo.Items;
        }

        private void ButtonOk_Click_1(object sender, RoutedEventArgs e)
        {
            SelectedFile = TreeViewFileInformation.SelectedItem as FileItem;
            this.Close();
        }

        private void ButtonCancel_Click_1(object sender, RoutedEventArgs e)
        {
            SelectedFile = null;
            this.Close();
        }

    }
}
